#include "stdafx.h"
#include "HbTransferListener.h"
#include "HBTransferItem.h"




CHBTransItemListener::CHBTransItemListener()
{

}

CHBTransItemListener& CHBTransItemListener::instance()
{
	static CHBTransItemListener listener;
	return listener;
}

void CHBTransItemListener::OnErrorOccur( const string& sTaskSN, int iErrorCode, const string& sErrorTips )
{
}

void CHBTransItemListener::OnFinish(CHBTransferItem* pItem)
{
}

void CHBTransItemListener::PushDetail( HBTransCode transCode, const string& sTaskSN )
{
	HBTransCodeInfo codeInfo = GetCodeInfo(transCode);
	if (LMT_ERROR == codeInfo.m_infoKind)
	{
		OnErrorOccur(sTaskSN, codeInfo.m_infoCode, codeInfo.m_infoDetailStr);
	}
}

void CHBTransItemListener::PushDetail_Curl( CURLcode curlCode, const string& sTaskSN )
{
	HBTransCodeInfo codeInfo = GetCodeInfo(curlCode);
	if (LMT_ERROR == codeInfo.m_infoKind)
	{
		OnErrorOccur(sTaskSN, codeInfo.m_infoCode, codeInfo.m_infoDetailStr);
	}
}
